import request from '@/utils/request'

// 查询验货列表
export function listCheckProduct(query) {
  return request({
    url: '/supplier/checkProduct/list',
    method: 'get',
    params: query
  })
}

// 查询验货详细
export function getCheckProduct(checkIdPk) {
  return request({
    url: '/supplier/checkProduct/' + checkIdPk,
    method: 'get'
  })
}

// 新增验货
export function addCheckProduct(data) {
  return request({
    url: '/supplier/checkProduct',
    method: 'post',
    data: data
  })
}

// 修改验货
export function updateCheckProduct(data) {
  return request({
    url: '/supplier/checkProduct',
    method: 'put',
    data: data
  })
}

// 删除验货
export function delCheckProduct(checkIdPk) {
  return request({
    url: '/supplier/checkProduct/' + checkIdPk,
    method: 'delete'
  })
}

// 导出验货
export function exportCheckProduct(query) {
  return request({
    url: '/supplier/checkProduct/export',
    method: 'get',
    params: query
  })
}

// 获取当前单号最大的值+1
export function generateNumber() {
  return request({
    url: '/supplier/businessNumber/generateCheckNumber' ,
    method: 'get'
  })
}

// 检查条形码是否重复
export function checkBarcode(data) {
  return request({
    url: '/supplier/checkProduct/checkBarcode' ,
    method: 'post',
    data: data
  })
}